{% extends 'rango/base.html' %}

{% block body_block %}
{% load static %}
    {% if user.is_authenticated %}
        <h1>Rango says good day to {{ user.username }}</h1>
    {% else %}
        <h1>Rango says good day to You!!!</h1>
    {% endif %}
    
    {% if categories %}
        <strong>Top 5 categories:</strong>
        <ul>
            {% for category in categories %}
            <li><a href="category/{{category.url}}">{{category.name}}</a></li>
            {% endfor %}
        </ul>
    {% else %}
        <strong>There is no categories present</strong><br/>
    {% endif %}

    {% if pages %}
        <strong>Top 5 pages:</strong>
        <ul>
            {% for page in pages %}
            <li><a href="{{page.url}}">{{page.title}}</a></li>
            {% endfor %}
        </ul>
    {% else %}
        <strong>There is no pages present</strong><br/>
    {% endif %}
{% endblock %}
